Skip to content

Conversation

@pyramation
Copy link
Contributor

No description provided.

- Add tests for JSON and TypeScript format outputs
- Add tests for disabled enum maps
- Add tests for partial output file configuration
- Update json.test.ts to specify output filenames
- Update test snapshots to reflect output file changes
- Document enum mapping refactoring completion
- Document the purpose and implementation of enum utility generation
- Explain the bidirectional lookup functionality
- Provide usage examples and configuration options
- Detail the AST generation process
- Include performance considerations and best practices
- Add generateEnumToIntFunctions for string to number conversions
- Add generateEnumToStringFunctions for number to string conversions
- Add configuration options for unidirectional generation
- Update store to support both bidirectional and unidirectional modes
- Add comprehensive tests for new functionality
- Update documentation to cover all three generation modes

Benefits:
- Cleaner, more precise TypeScript types
- Better IDE support and IntelliSense
- Smaller bundle sizes with tree-shaking
- Slightly better performance for single-direction conversions
- Add generateEnumToIntFunctionsNested and generateEnumToStringFunctionsNested
- Add outputFormat option: 'switchStatements' | 'nestedObjects'
- Generate typed object maps with individual converter functions per enum
- Update store logic to support both output formats
- Add comprehensive tests for nested objects format
- Update documentation with nested objects usage and benefits

Benefits of nested objects format:
- Better tree-shaking - import only specific enum converters
- Direct property access without passing enum name
- Type-safe enum property access
- More modular code organization
- Add documentation for unidirectional enum conversion functions
- Document nested objects output format option
- Include examples for all three generation modes
- Update features list to highlight new capabilities
- Add configuration options table for new enum utility settings
- Add optional isNode boolean parameter to all generated helper methods
- When isNode is true, return wrapped object format: { TypeName: instance }
- When isNode is false/undefined, return raw type (backward compatible)
- Update return types to union of Type | { Type: Type }
- Update test snapshots to reflect new signatures

Benefits:
- Maintains backward compatibility (isNode defaults to false)
- Enables programmatic node type identification
- Useful for AST construction with embedded type information
- Type-safe with TypeScript union types
@pyramation pyramation merged commit 7e09281 into main Jun 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants